<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" 
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:composition>
        <style type="text/css">
            table.costTable input{
                border: none;      
                padding:2px 4px 2px 4px;
                text-align: center;
                width:80%;
                margin:0;
            }
            table.backTable input{
                border: none;          
            }
            .inputstype{
                width: 175px !important;
            }
            .pic{
                margin-bottom: -4px;
                margin-right: -2px;
                border:none;
                width:20px;
                height:20px;
            }
            .selectStyle{
                width: 200px;
            }
        </style>
        <script type="text/javascript">
            javascript:window.history.forward(1);
        </script>
        <script type="text/javascript">
            var currentLine = 1;
            function showGroupList() {
                window.open("./business/person/abroadGroupGroupList.jsf", "团组列表", "height=280,width=600,toolbar=no,menubar=no,scrollbars=no");
            }
            function updateGroup(code, name)
            {
                document.getElementById('abrodForm:groupCode').value = code;
                document.getElementById('abrodForm:groupName').value = name;
            }
            var size = 0;
            function setCurrencyofGroup(lineId, costLiSize) {
                size = costLiSize;
                currentLine = lineId;
            }
            function updateCurrencyofGroup(code, name) {
                var form = document.forms['abrodForm'];
                form[11 + currentLine * 8].value = code;
                form[12 + currentLine * 8].value = name;
                form[14 + size * 8 + (currentLine) * 5].value = code;
                form[15 + size * 8 + (currentLine) * 5].value = name;
            }
            function showPayStyle() {
                window.open("./business/person/payStyleList.jsf", "支付方式", "height=280,width=600,toolbar=no,menubar=no,scrollbars=no");
            }
            function updatePayStyle(code, name) {
                document.getElementById('abrodForm:payStyleCode').value = code;
                document.getElementById('abrodForm:payStyleName').value = name;
            }
            function showProj() {
                window.open("./pubinfo/projList.jsf", "项目列表", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
            }
            function updateProjSelect(code, name) {
                document.getElementById('abrodForm:projCode').value = code;
                document.getElementById('abrodForm:projName').value = name;
            }
        </script>
        <h:body>
            <h:form id="abrodForm">
                <rich:panel styleClass="content-hight">
                    <rich:messages globalOnly="true"/>
                    <h:panelGrid columns="4">
                        <h:outputLabel value="单据状态:"/>
                        <h:panelGroup>
                            <h:outputText value="已提交等待审核"  rendered="#{abroadGroupBean.abroad.numberStatus eq '0'}" style="color:green"/>
                            <h:outputText value="未提交" rendered="#{abroadGroupBean.abroad.numberStatus eq '1'}" style="color:red"/>
                            <h:outputText value="审核通过等待支付"  rendered="#{abroadGroupBean.abroad.numberStatus eq '2'}" style="color:blue"/>
                            <h:outputText value="退回修改"  rendered="#{abroadGroupBean.abroad.numberStatus eq '3'}" style="color:red"/>
                            <h:outputText value="确认支付"  rendered="#{abroadGroupBean.abroad.numberStatus eq '4'}" style="color:blue"/>
                            <h:outputText value="撤单"  rendered="#{abroadGroupBean.abroad.numberStatus eq '5'}" style="color:red"/>
                            <h:outputText value="支付完毕"  rendered="#{abroadGroupBean.abroad.numberStatus eq '6'}" style="color:blue"/>
                        </h:panelGroup>
                        <h:outputLabel value="审核信息：" rendered="#{not empty abroadGroupBean.abroad.checkInfo}" style="margin-left: 50px;"/>
                        <h:outputText value="#{abroadGroupBean.abroad.checkInfo}"/>
                    </h:panelGrid>
                    <rich:toolbar  itemSeparator="grida">
                        <rich:toolbarGroup>

                            <h:commandLink action="#{abroadGroupBean.add}"
                                           disabled="#{!abroadGroupBean.showAble}" style=" margin: 1px;">
                                <h:graphicImage value="./images/create_doc.gif" styleClass="pic"  title="新增" />
                            </h:commandLink>

                            <h:commandLink  action="#{abroadGroupBean.checkSave}"
                                            disabled="#{abroadGroupBean.showAble}" style=" margin: 1px;"
                                            actionListener="#{abroadGroupBean.clearQueryResult}">
                                <h:graphicImage value="./images/save.gif" styleClass="pic" title="保存"/>
                            </h:commandLink>

                            <h:commandLink  action="#{abroadGroupBean.update}" style=" margin: 1px;"
                                            disabled="#{abroadGroupBean.addOrUpdate || abroadGroupBean.abroad.number eq '' || (abroadGroupBean.abroad.numberStatus != '1' and abroadGroupBean.abroad.numberStatus != '3')}">
                                <h:graphicImage value="./images/edit.gif" styleClass="pic"  title="修改"/>
                            </h:commandLink>

                            <h:commandLink  action="#{abroadGroupBean.delete}"
                                            actionListener="#{abroadGroupBean.clearQueryResult}" style=" margin: 1px;"
                                            disabled="#{abroadGroupBean.addOrUpdate || abroadGroupBean.abroad.number eq '' || (abroadGroupBean.abroad.numberStatus != '1' and abroadGroupBean.abroad.numberStatus != '3')}">
                                <h:graphicImage value="./images/delete.gif" styleClass="pic"  title="删除"/>
                            </h:commandLink>

                            <h:commandLink action="#{abroadGroupBean.cancel}" immediate="true"
                                           disabled="#{abroadGroupBean.showAble}"
                                           style=" margin: 1px;text-decoration: none;">
                                <h:panelGroup style="white-space: nowrap;">
                                    <h:graphicImage value="./images/cancel.png" styleClass="pic"/>
                                    <h:outputLabel value="取消" />
                                </h:panelGroup>
                            </h:commandLink>

                            <h:commandLink  action="#{abroadGroupBean.submitBill}"
                                            actionListener="#{abroadGroupBean.clearQueryResult}" style=" margin: 1px;text-decoration: none;"
                                            disabled="#{abroadGroupBean.addOrUpdate || abroadGroupBean.abroad.number eq '' || !abroadGroupBean.saveOrNot || abroadGroupBean.abroad.numberStatus != '1'}">
                                <h:panelGroup style="white-space: nowrap;">
                                    <h:graphicImage value="./images/submit.png" styleClass="pic" />
                                    <h:outputLabel value="提交" />
                                </h:panelGroup>
                            </h:commandLink>

                            <h:commandLink action="#{abroadGroupBean.rescind}"
                                           actionListener="#{abroadGroupBean.clearQueryResult}" style=" margin: 1px;text-decoration: none;"
                                           disabled="#{abroadGroupBean.abroad.numberStatus != '0' || !abroadGroupBean.showAble}" >
                                <h:panelGroup style="white-space: nowrap;">
                                    <h:graphicImage value="./images/repeat.png" styleClass="pic" />
                                    <h:outputLabel value="撤单" />
                                </h:panelGroup>
                            </h:commandLink>

                            <h:commandLink  action="#{abroadGroupBean.getFirst}"
                                            disabled="#{!abroadGroupBean.showAble}" style=" margin: 1px;">
                                <h:graphicImage value="./images/btn_page_first.gif" styleClass="pic" title="首张"/>
                            </h:commandLink>

                            <h:commandLink   action="#{abroadGroupBean.previouse}"
                                             disabled="#{!abroadGroupBean.showAble}" style=" margin: 1px;">
                                <h:graphicImage value="./images/btn_page_up.gif" styleClass="pic" title="上张"/>
                            </h:commandLink>

                            <h:commandLink  action="#{abroadGroupBean.next}"
                                            disabled="#{!abroadGroupBean.showAble}" style=" margin: 1px;">
                                <h:graphicImage value="./images/btn_page_down.gif" styleClass="pic" title="下张"/>
                            </h:commandLink>

                            <h:commandLink action="#{abroadGroupBean.getLast}"
                                           disabled="#{!abroadGroupBean.showAble}" style="margin: 1px;">
                                <h:graphicImage value="./images/btn_page_end.gif" styleClass="pic" title="末张"/>
                            </h:commandLink>

                            <a4j:commandLink  render="loanPdf" execute="@form"
                                              oncomplete="#{rich:component('voucherPanel')}.show();" style=" margin: 1px;"
                                              disabled="#{!abroadGroupBean.showAble or empty abroadGroupBean.abroad.number}">
                                <h:graphicImage value="./images/print.gif" styleClass="pic" title="打印"/>
                            </a4j:commandLink>


                        </rich:toolbarGroup>
                    </rich:toolbar>         
                    <p style="text-align:center;font-family:黑体;font-weight:bold;font-size: 20px !important;" >出 国 差 旅 费 报 销 单</p>
                    <hr style="border:1px dashed;"/>
                    <h:panelGrid columns="6" border="0" id="abroadBasic" style="width:780px;text-align:left;">
                        <h:outputLabel value="单据编号:"/>
                        <h:inputText id="number" value="#{abroadGroupBean.abroad.number}" size="28" disabled="true" />
                        <rich:message for="number"/>

                        <h:outputLabel value="填单日期:"/>
                        <rich:calendar id="billDate" value="#{abroadGroupBean.abroad.numDate}"
                                       disabled="#{abroadGroupBean.showAble}"
                                       locale="zh_CN"
                                       popup="true"
                                       datePattern="yyyy-MM-dd"
                                       showApplyButton="false"
                                       inputClass="inputstype"
                                       required="true" requiredMessage="不能为空">
                        </rich:calendar>
                        <rich:message for="billDate"/>

                        <h:outputLabel value="预算项目:"  />
                        <h:inputText  id="projName"   size="28" disabled="#{abroadGroupBean.showAble}" value="#{abroadGroupBean.abroad.project.finName}"
                                      onclick="#{rich:component('projPanel')}.show();"/>
                        <rich:message for="projName"/>

                        <h:outputLabel value="报销部门:" />                
                        <h:inputText  id="paydept"  disabled="#{abroadGroupBean.showAble}" value="#{abroadGroupBean.abroad.payDept.name}"
                                      size="28"  onclick="#{rich:component('deptPanel')}.show();"/>
                        <rich:message for="paydept"/>

                        <h:outputLabel value="报销人(经办人)：" />
                        <h:selectOneMenu id="feePerson" value="#{abroadGroupBean.abroad.feePer.cpsn_number}"
                                         styleClass="selectStyle"
                                         disabled="#{abroadGroupBean.showAble}">
                            <f:selectItem itemValue="" itemLabel="-请选择-"/>
                            <f:selectItems value="#{abroadGroupBean.perli}" />
                        </h:selectOneMenu>
                        <rich:message for="feePerson"/>

                        <h:outputLabel value="事 由:"/>
                        <h:inputText id="affair" value="#{abroadGroupBean.abroad.affair}"
                                     disabled="#{abroadGroupBean.showAble}" size="28"
                                     required="true" requiredMessage="不能为空"
                                     validatorMessage="请勿超过30个字">
                            <f:validateLength maximum="30"/>
                        </h:inputText>
                        <rich:message for="affair"/>

                        <h:outputLabel value="备 注"/>
                        <h:inputText id="memo" value="#{abroadGroupBean.abroad.memo}"
                                     disabled="#{abroadGroupBean.showAble}" size="28"
                                     validatorMessage="请勿超过50个字">
                            <f:validateLength maximum="50"/>
                        </h:inputText>
                        <rich:message for="memo"/>                

                        <h:outputLabel value="国 家:"/>
                        <h:inputText id="country" value="#{abroadGroupBean.abroad.group.country}"
                                     disabled="#{abroadGroupBean.showAble}" size="28"
                                     required="true" requiredMessage="不能为空"
                                     validatorMessage="请勿超过20个字">
                            <f:validateLength maximum="20"/>
                        </h:inputText>
                        <rich:message for="country"/>

                        <h:outputLabel value="人员列表:"/>
                        <h:inputText id="member" value="#{abroadGroupBean.abroad.group.member}"
                                     disabled="#{abroadGroupBean.showAble}" size="28"
                                     required="true" requiredMessage="不能为空"
                                     validatorMessage="请勿超过70个字">
                            <f:validateLength maximum="70"/>
                        </h:inputText>
                        <rich:message for="member"/>

                        <h:outputLabel value="出发日期:"/>
                        <rich:calendar id="startDate" value="#{abroadGroupBean.abroad.group.startDate}"
                                       disabled="#{abroadGroupBean.showAble}"
                                       locale="zh_CN"
                                       popup="true"
                                       datePattern="yyyy-MM-dd"
                                       showApplyButton="false"
                                       inputClass="inputstype"
                                       required="true" requiredMessage="不能为空">
                        </rich:calendar>
                        <rich:message for="startDate"/>

                        <h:outputLabel value="返回日期:" />
                        <rich:calendar id="endDate" value="#{abroadGroupBean.abroad.group.endDate}"
                                       disabled="#{abroadGroupBean.showAble}"
                                       locale="zh_CN"
                                       popup="true"
                                       datePattern="yyyy-MM-dd"
                                       showApplyButton="false"
                                       inputClass="inputstype"
                                       required="true" requiredMessage="不能为空">
                        </rich:calendar>
                        <rich:message for="endDate"/>

                        <h:outputLabel value="支付方式: "/>
                        <h:selectOneMenu id="payWay"
                                         value="#{abroadGroupBean.payWay}"
                                         disabled="#{abroadGroupBean.showAble}"
                                         style="width:198px;"
                                         required="true" requiredMessage="不能为空">
                            <f:selectItems value = "#{abroadGroupBean.payStyleList}"/>
                        </h:selectOneMenu>
                        <rich:message for="payWay"/>

                        <h:outputLabel value="附件张数:"/>
                        <h:inputText id="affixAmount" value="#{abroadGroupBean.abroad.affixAmount}"
                                     disabled="#{abroadGroupBean.showAble}" size="28"
                                     required="true" requiredMessage="不能为空"/>
                        <rich:message for="affixAmount"/>

                        <h:outputLabel value="制 单 人:"/>
                        <h:outputText value="#{abroadGroupBean.abroad.user.cpsn_name}"/>
                    </h:panelGrid>

                    <h:inputHidden id="groupCode" value="#{abroadGroupBean.abroad.group.code}"/>
                    <h:inputHidden id="payStyleCode" value="#{abroadGroupBean.abroad.payStyle.code}"/>          

                    <h:panelGroup id="feeDetail">
                        <rich:dataTable value="#{abroadGroupBean.costModel}"
                                        style="width:750px;" var="co" id="fei"
                                        rowKeyVar="rowKey">

                            <rich:column style="width:30px;text-align:center;">
                                <f:facet name="header">
                                    <h:outputText value="行号"/>
                                </f:facet>
                                <h:outputText value="#{rowKey+1}"/>
                            </rich:column>

                            <rich:column style="width:40px;text-align:center;">
                                <f:facet name="header">
                                    <h:panelGroup style="white-space: nowrap;">
                                        <a4j:commandLink action="#{abroadGroupBean.addLine}" disabled="#{abroadGroupBean.showAble}"
                                                         execute="feeDetail" render="feeDetail">
                                            <h:outputText value="増行"/>
                                        </a4j:commandLink>
                                    </h:panelGroup>
                                </f:facet>
                                <a4j:commandLink action="#{abroadGroupBean.delLine}" disabled="#{abroadGroupBean.showAble}"
                                                 execute="feeDetail" render="feeDetail">
                                    <h:outputText value="删除"/>
                                </a4j:commandLink>
                            </rich:column>

                            <rich:column style="width:50px;">
                                <f:facet name="header">               
                                    <h:panelGroup style="white-space: nowrap;">
                                        <h:outputText value="币种代码"/>
                                    </h:panelGroup>
                                </f:facet>
                                <h:inputText value="#{co.currency.code}" style="width:100%;"
                                             disabled="#{abroadGroupBean.showAble}"
                                             onclick="setCurrencyofGroup('#{rowKey+1}', '#{abroadGroupBean.costLiSize}');#{rich:component('currencyPop')}.show();"/>
                            </rich:column>

                            <rich:column style="width:50px;">
                                <f:facet name="header">
                                    <h:outputText value="币种"/>
                                </f:facet>
                                <h:inputText id="groupCurrency#{co.lineId}" value="#{co.currency.name}"
                                             style="width: 100%;" disabled="#{abroadGroupBean.showAble}"
                                             onclick="setCurrencyofGroup('#{rowKey+1}', '#{abroadGroupBean.costLiSize}');#{rich:component('currencyPop')}.show();"/>
                            </rich:column>

                            <rich:column style="width:70px;">
                                <f:facet name="header">
                                    <h:outputText value="住宿费"/>
                                </f:facet>
                                <h:inputText id="stayCost" value="#{co.stayCost}" style="width: 100%;" disabled="#{abroadGroupBean.showAble}"
                                             converterMessage="请输入数字" >
                                    <a4j:ajax event="keyup" render="total" />
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:inputText>
                                <h:message for="stayCost" style="color:red"/>
                            </rich:column>

                            <rich:column style="width:70px;">
                                <f:facet name="header">
                                    <h:outputText value="伙食补助费"/>
                                </f:facet>
                                <h:inputText id="foodCost" value="#{co.foodCost}" style="width: 100%;" disabled="#{abroadGroupBean.showAble}"
                                             converterMessage="请输入数字">
                                    <a4j:ajax event="keyup" render="total" />
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:inputText>
                                <h:message for="foodCost" style="color:red"/>
                            </rich:column>

                            <rich:column style="width:70px;">
                                <f:facet name="header">
                                    <h:outputText value="公杂费"/>
                                </f:facet>
                                <h:inputText id="mixCost" value="#{co.mixCost}" style="width: 100%;" disabled="#{abroadGroupBean.showAble}"
                                             converterMessage="请输入数字" >
                                    <a4j:ajax event="keyup" render="total" />
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:inputText>
                                <h:message for="mixCost" style="color:red"/>
                            </rich:column>

                            <rich:column style="width:70px;">
                                <f:facet name="header">
                                    <h:outputText value="个人零用费"/>
                                </f:facet>
                                <h:inputText id="personalCost" value="#{co.personalCost}" style="width: 100%;" disabled="#{abroadGroupBean.showAble}"
                                             converterMessage="请输入数字" >
                                    <a4j:ajax event="keyup" render="total" />
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:inputText>
                                <h:message for="personalCost" style="color:red"/>
                            </rich:column>

                            <rich:column style="width:80px;">
                                <f:facet name="header">
                                    <h:panelGroup style="white-space: nowrap;">
                                        <h:outputText value="城市间交通费"/>
                                    </h:panelGroup>
                                </f:facet>
                                <h:inputText id="trafficCost" value="#{co.trafficCost}" style="width: 100%;" disabled="#{abroadGroupBean.showAble}"
                                             converterMessage="请输入数字" >
                                    <a4j:ajax event="keyup" render="total" />
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:inputText>
                                <h:message for="trafficCost" style="color:red"/>
                            </rich:column>

                            <rich:column>
                                <f:facet name="header">
                                    <h:outputText value="其他"/>
                                </f:facet>
                                <h:inputText  id="otherCost" value="#{co.other}" style="width: 100%;" disabled="#{abroadGroupBean.showAble}"
                                              converterMessage="请输入数字" >
                                    <a4j:ajax event="keyup" render="total" />
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:inputText>
                                <h:message for="otherCost" style="color:red"/>
                            </rich:column>

                            <rich:column>
                                <f:facet name="header">
                                    <h:panelGroup style="white-space: nowrap;">
                                        <h:outputText value="小计"/>
                                    </h:panelGroup>
                                </f:facet>
                                <h:outputText id="total" value="#{co.other + co.trafficCost + co.personalCost + co.mixCost + co.foodCost + co.stayCost}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                            </rich:column>

                        </rich:dataTable>

                        <rich:dataTable value="#{abroadGroupBean.backModel}" var="tl" id="back"
                                        style="width:750px;"
                                        rowKeyVar="rowKey">
                            <rich:column style=" text-align:  center; width: 29px;" >
                                <f:facet name="header">
                                    <h:outputText value="行号"/>
                                </f:facet>
                                <h:outputText value="#{rowKey+1}"/>
                            </rich:column>

                            <rich:column style=" text-align:  center;width: 58px;">
                                <f:facet name="header">
                                    <h:outputText value="币种代码"/>
                                </f:facet>
                                <h:inputText value="#{tl.currency.code}" 
                                             disabled="#{abroadGroupBean.showAble}"
                                             style="width: 100%;"/>
                            </rich:column>

                            <rich:column style=" text-align:  center;width: 58px;">
                                <f:facet name="header">
                                    <h:outputText value="币种"/>
                                </f:facet>
                                <h:inputText value="#{tl.currency.name}" 
                                             disabled="#{abroadGroupBean.showAble}"
                                             style="width: 100%;">
                                </h:inputText>
                            </rich:column>

                            <rich:column style=" text-align:  center;width: 220px;">
                                <f:facet name="header">
                                    <h:outputText value="预借金额" />
                                </f:facet>
                                <h:inputText id="advance" value="#{tl.advance}"  disabled="#{abroadGroupBean.showAble}"
                                             converterMessage="请输入数字"  style="width: 100%;">
                                    <a4j:ajax  immediate="false" event="keyup" render="sign,amount" disabled="#{abroadGroupBean.showAble}"  listener="#{abroadGroupBean.autoValue}"/>
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:inputText>
                                <h:message for="advance" style="color:red"/>
                            </rich:column>

                            <rich:column style=" text-align:  center;width: 170px;">
                                <f:facet name="header">
                                    <h:outputText value="退或领"/>
                                </f:facet>
                                <h:selectOneRadio id="sign" value="#{tl.sign}"
                                                  disabled="#{abroadGroupBean.showAble}">
                                    <f:selectItem itemLabel="退" itemValue="退"/>
                                    <f:selectItem itemLabel="领" itemValue="领" />
                                </h:selectOneRadio>
                            </rich:column>

                            <rich:column style=" text-align:  center;">
                                <f:facet name="header">
                                    <h:outputText value="退(领)金额"/>
                                </f:facet>
                                <h:outputText id="amount" value="#{tl.amount}" >
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                                <h:message for="amount" style="color:red"/>
                            </rich:column>
                        </rich:dataTable>
                    </h:panelGroup>
                </rich:panel>

            </h:form>
        </h:body>

        <rich:popupPanel id="voucherPanel" width="950" height="600">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="打印"></h:outputText>
                </h:panelGroup>
            </f:facet>

            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('voucherPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <a4j:mediaOutput element="object" cacheable="false" id="loanPdf"
                             uriAttribute="data"
                             standby="Loading Pdf..." mimeType="application/pdf"
                             type="application/pdf" style="width: 900px;height: 550px"
                             createContent="#{abroadGroupBean.process}" />
        </rich:popupPanel> 

        <rich:popupPanel id="deptPanel" autosized="true">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="费用承担部门"></h:outputText>
                </h:panelGroup>
            </f:facet>
            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('deptPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <h:form>
                <rich:panel>
                    <h:panelGrid columns="2"  border="0" id="mainform">
                        <rich:tree value="#{departmentBean.rootNode}" var="idept"
                                   selectionType="ajax" toggleType="client"
                                   selectionChangeListener="#{abroadGroupBean.selected}"
                                   style="width:300px" render="paydept,feePerson">
                            <rich:treeNode>
                                <h:outputText value="[#{idept.data.code}]#{idept.data.name}" />
                                <rich:componentControl target="deptPanel" operation="hide" event="click"/>
                            </rich:treeNode>
                        </rich:tree>
                    </h:panelGrid>
                </rich:panel>
            </h:form>

            <f:facet name="footer">
                footer!
            </f:facet>

        </rich:popupPanel>

        <rich:popupPanel id="projPanel" autosized="true">
            <f:facet name="header">项目信息</f:facet>
            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('projPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <h:form id="projList">
                <rich:dataTable id="editTable" value="#{abroadGroupBean.finProjModel}" rows="10"  var="pro">
                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="预算项目编码"/>
                            </h:panelGroup>
                        </f:facet>
                        <a4j:commandLink id="Projlinks" action="#{abroadGroupBean.projSelected}"
                                         onclick="#{rich:component('projPanel')}.hide();"
                                         render="projName" >
                            <h:outputText value="#{pro.finCode}"/>
                        </a4j:commandLink>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="预算项目名称"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pro.finName}"/>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="备注"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pro.memo}"/>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:dataScroller id="ds"></rich:dataScroller>
                    </f:facet>
                </rich:dataTable>
            </h:form>
        </rich:popupPanel>

        <rich:popupPanel id="deptQueryPanel" autosized="true">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="费用承担部门"></h:outputText>
                </h:panelGroup>
            </f:facet>
            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('deptQueryPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <h:form>
                <rich:panel>
                    <h:panelGrid columns="2" width="100%" border="0" id="mainform">
                        <rich:tree value="#{departmentBean.rootNode}" var="idept"
                                   selectionType="ajax" toggleType="client"
                                   selectionChangeListener="#{abroadGroupBean.selecteDeptForQuery}"
                                   style="width:300px" render="depname">
                            <rich:treeNode>
                                <h:outputText value="[#{idept.data.code}]#{idept.data.name}" />
                                <rich:componentControl target="deptQueryPanel" operation="hide" event="click"/>
                            </rich:treeNode>
                        </rich:tree>
                    </h:panelGrid>
                </rich:panel>
            </h:form>

            <f:facet name="footer">
                footer!
            </f:facet>
        </rich:popupPanel>

        <rich:popupPanel header="币种" id="currencyPop" autosized="true">
            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('currencyPop')}.hide();">关闭</h:outputLink>
            </f:facet>

            <h:form>
                <rich:dataTable value="#{abroadGroupBean.currencyLi}" var="tl" id="back">
                    <rich:column>
                        <f:facet name="header">币种代码</f:facet>
                        <h:commandLink onclick="updateCurrencyofGroup('#{tl.code}', '#{tl.name}');#{rich:component('currencyPop')}.hide();
                return false;">
                            <h:outputText value="#{tl.code}"/>
                        </h:commandLink>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">币种名称</f:facet>
                        <h:outputText value="#{tl.name}"/>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">符号</f:facet>
                        <h:outputText value="#{tl.sign}" rendered="#{tl.code !='ECU'}"/>
                        <h:outputText value="€"  rendered="#{tl.code =='ECU'}"/>
                    </rich:column>
                </rich:dataTable>
            </h:form>
        </rich:popupPanel>
    </ui:composition>
</html>